package com.hqq;

import com.hqq.servive.impl.BuyGoodsService;
import com.hqq.servive.impl.BuyGoodsServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test {
    @Test
    public void test01() {
        String config = "applicationContext.xml";
        ApplicationContext ctx = new ClassPathXmlApplicationContext(config);

        //获取service
        BuyGoodsService service = (BuyGoodsService)ctx.getBean("BuyGoodsService");
        System.out.println(service.getClass().getName());

        //已经给sale增加 但库存不会增减
        service.buyGoods(1002,20);

    }
}
